# -*- coding: utf-8 -*-
"""
Created on 2016/9/1 21:32
@File: add_data.py
@Author: Liangrong Li
@   用于媳妇测试数据库 快速生成sql 批量插入语句
"""
import sys


def main(sid=None):
    reload(sys)
    sys.setdefaultencoding('utf-8')
    sid = 266691
    virtual = 105382010401755100000001329
    bank_name = '中国农业银行苏州吴中支行营业部'
    bank_code = '10538201040175510'
    acc_name = '苏州市吴中农村产权交易中心有限公司'
    state = '0'
    area_code = '2'
    with open('sql_list.txt', 'w') as f:
        for i in xrange(100):
            sid += 1
            virtual += 1
            line = "INSERT INTO virtual_account_info (ID, BANK_NAME, VIRTUAL, STATE, BANK_CODE, AREA_CODE, ACC_NAME) VALUES ("+str(sid)+",'"+bank_name+"','"+str(virtual)+"', '"+state+"', '"+bank_code+"','"+area_code+"','"+acc_name+"');\n"
            f.write(line)

if __name__ == '__main__':
    import time
    start = time.clock()

    main()

    end = time.clock()
    print "run time is %f s" % (end - start)
